
//import java.text.SimpleDateFormat;
//import java.time.DateTimeException;
//import java.time.LocalDate;
//import java.time.format.DateTimeParseException;
//import java.time.temporal.ChronoUnit;
//import java.util.*;
//public class Main {
//    public static void main(String[] args)   {
//        Scanner sc=new Scanner(System.in);
//        String d1=sc.next();
//        String d2=sc.next();
//        SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd");
//        try {
//            LocalDate date1 = LocalDate.parse(d1);
//            LocalDate date2 = LocalDate.parse(d2);
//
//            if (date1.isAfter(date2)) {
//                System.out.println("结束日期早于起始日期，不合法！");
//                return;
//            } else {
//                long diff=ChronoUnit.DAYS.between(date1,date2);
//                System.out.println(d1 + "到" + d2 + "之间相差" + diff + "天");
//            }
//        }
//        catch (DateTimeParseException e)
//        {
//            System.out.println(d1+"或"+d2+"中有不合法的日期。");
//        }
//    }
//}

import javax.swing.text.DateFormatter;
import java.text.DateFormat;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String d1=sc.next();

        DateTimeFormatter d2=DateTimeFormatter.ofPattern("yyyy-MM-dd");
        try{
            LocalDate date= (LocalDate) d2.parse(d1);
            boolean flg=date.isLeapYear();
            String bool="不是";
            if(flg)
                bool="是";
            int yday=date.getDayOfYear();
            int mday=date.getDayOfMonth();
            DayOfWeek wday=date.getDayOfWeek();
            Map<DayOfWeek,Integer> map=new HashMap<DayOfWeek,Integer>();
            map.put(DayOfWeek.MONDAY,1);
            map.put(DayOfWeek.THURSDAY,4);
            map.put(DayOfWeek.FRIDAY,5);
            map.put(DayOfWeek.SATURDAY,6);
            map.put(DayOfWeek.SUNDAY,7);
            map.put(DayOfWeek.WEDNESDAY,3);
            map.put(DayOfWeek.TUESDAY,2);


            System.out.println(d1+bool+"闰年。");
            System.out.println(d1+"是当年第"+yday+"天，当月第"+mday+"天，当周第"+map.get(wday)+"天。");

        }
        catch (DateTimeParseException e)
        {
            System.out.println(d1+"无效！");
        }
    }
}